home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Snippets / PNL Libraries / Libraries / SpriteWorld / SpriteWorld files / Headers / BlitPixie.h next >
Text File  |  1996-10-29  |  6KB  |  255 lines

  1. ///--------------------------------------------------------------------------------------
  2. //    BlitPixie.h
  3. //
  4. //    Description: This is the include file for all the BlitPixie source files.
  5. ///--------------------------------------------------------------------------------------
  6.  
  7.  
  8. #ifndef __BLITPIXIE__
  9. #define __BLITPIXIE__
  10.  
  11. #ifndef __SWCOMMON__
  12. #include "SWCommonHeaders.h"
  13. #endif
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <QuickDraw.h>
  17. #endif
  18.  
  19. #ifndef __SPRITEFRAME__
  20. #include "SpriteFrame.h"
  21. #endif
  22.  
  23. #ifndef __SPRITE__
  24. #include "Sprite.h"
  25. #endif
  26.  
  27. #if PRAGMA_ALIGN_SUPPORTED
  28. #pragma options align=mac68k
  29. #endif
  30.  
  31.  
  32. ///--------------------------------------------------------------------------------------
  33. //        type definitions & conditional macros
  34. ///--------------------------------------------------------------------------------------
  35.  
  36. #if SW_PPC
  37. #define SW_USE_C 1
  38. #endif
  39. /*
  40. typedef double PixelChunk, *PixelChunkPtr, **PixelChunkHdl;
  41.  
  42. #define BytesToChunks(b) ((b) >> 3)
  43. #define ChunksToBytes(b) ((b) << 3)
  44.  
  45.  
  46. #else    // SW_PPC
  47. */
  48. typedef unsigned long PixelChunk, *PixelChunkPtr, **PixelChunkHdl;
  49.  
  50. #define BytesToChunks(b) ((b) >> 2)
  51. #define ChunksToBytes(b) ((b) << 2)
  52.  
  53. //#endif    // SW_PPC
  54.  
  55.  
  56. typedef unsigned long* PixelPtr;
  57.  
  58. typedef struct StarArray
  59. {
  60.     short    horizLoc;            // Current horizontal position of the star
  61.     short    vertLoc;            // Current vertical position of the star
  62.     short    oldHorizLoc;        // Horizontal position of star the previous frame
  63.     short    oldVertLoc;            // Vertical position of star the previous frame
  64.     short    horizSpeed;            // To be used by the user to move the star
  65.     short    vertSpeed;            // To be used by the user to move the star
  66.     short    color;                // Current color of the star
  67.     Boolean    needsToBeErased;    // If drawn last frame, then it needs to be erased.
  68.     short    userData;            // Reserved for user 
  69. } StarArray;
  70.  
  71.  
  72. ///--------------------------------------------------------------------------------------
  73. //    Function prototypes for all-bit blitters
  74. ///--------------------------------------------------------------------------------------
  75.  
  76. #ifdef __cplusplus
  77. extern "C" {
  78. #endif
  79.  
  80.  
  81. SW_FUNC void BlitPixieAllBitRectDrawProc(
  82.     FramePtr srcFrameP,
  83.     FramePtr dstFrameP,
  84.     Rect *srcRect,
  85.     Rect *dstRect);
  86.  
  87. SW_FUNC void BPAllBitInterlacedRectDrawProc(
  88.     FramePtr srcFrameP,
  89.     FramePtr dstFrameP,
  90.     Rect* srcRect,
  91.     Rect* dstRect);
  92.  
  93. SW_FUNC void BlitPixieAllBitMaskDrawProc(
  94.     FramePtr srcFrameP,
  95.     FramePtr dstFrameP,
  96.     Rect *srcRect,
  97.     Rect *dstRect);
  98.  
  99. SW_FUNC void BlitPixieAllBitPartialMaskDrawProc(
  100.     FramePtr srcFrameP,
  101.     FramePtr dstFrameP,
  102.     Rect *srcRect,
  103.     Rect *dstRect);
  104.  
  105. SW_FUNC void BPAllBitInterlacedMaskDrawProc(
  106.     FramePtr srcFrameP,
  107.     FramePtr dstFrameP,
  108.     Rect* srcRect,
  109.     Rect* dstRect);
  110.  
  111. SW_FUNC void BPAllBitInterlacedPartialMaskDrawProc(
  112.     FramePtr srcFrameP,
  113.     FramePtr dstFrameP,
  114.     Rect* srcRect,
  115.     Rect* dstRect);
  116.  
  117. SW_ASM_FUNC void BlitPixieAllBit(
  118.     register PixelPtr srcPixelP,
  119.     register PixelPtr dstPixelP,
  120.     unsigned long rowsToCopy,
  121.     unsigned long numBytesPerRow,
  122.     register unsigned long srcRowStride,
  123.     register unsigned long dstRowStride,
  124.     register unsigned long srcExtraStart,
  125.     register unsigned long dstExtraStart,
  126.     register unsigned long dstExtraEnd);
  127.     
  128. SW_ASM_FUNC void BlitPixieAllBitMask(
  129.     register PixelPtr srcPixelP,
  130.     register PixelPtr dstPixelP,
  131.     register PixelPtr maskPixelP,
  132.     unsigned long rowsToCopy,
  133.     unsigned long numBytesPerRow,
  134.     register unsigned long srcRowStride,
  135.     register unsigned long dstRowStride,
  136.     register unsigned long srcExtraStart,
  137.     register unsigned long dstExtraStart,
  138.     register unsigned long dstExtraEnd);
  139.     
  140. SW_ASM_FUNC void BlitPixieAllBitPartialMask(
  141.     register PixelPtr srcPixelP,
  142.     register PixelPtr dstPixelP,
  143.     register PixelPtr maskPixelP,
  144.     unsigned long rowsToCopy,
  145.     unsigned long numBytesPerRow,
  146.     register unsigned long srcRowStride,
  147.     register unsigned long dstRowStride,
  148.     register unsigned long srcExtraStart,
  149.     register unsigned long dstExtraStart,
  150.     register unsigned long dstExtraEnd);
  151.  
  152.     
  153.  
  154. ///--------------------------------------------------------------------------------------
  155. //    Function prototypes for 8-bit blitters
  156. ///--------------------------------------------------------------------------------------
  157.  
  158.  
  159. SW_FUNC void BlitPixie8BitRectDrawProc(
  160.     FramePtr srcFrameP,
  161.     FramePtr dstFrameP,
  162.     Rect *srcRect,
  163.     Rect *dstRect);
  164.  
  165. SW_FUNC void BP8BitInterlacedRectDrawProc(
  166.     FramePtr srcFrameP,
  167.     FramePtr dstFrameP,
  168.     Rect* srcRect,
  169.     Rect* dstRect);
  170.  
  171. SW_FUNC void BlitPixie8BitMaskDrawProc(
  172.     FramePtr srcFrameP,
  173.     FramePtr dstFrameP,
  174.     Rect *srcRect,
  175.     Rect *dstRect);
  176.  
  177. SW_FUNC void BlitPixie8BitPartialMaskDrawProc(
  178.     FramePtr srcFrameP,
  179.     FramePtr dstFrameP,
  180.     Rect *srcRect,
  181.     Rect *dstRect);
  182.  
  183. SW_FUNC void BP8BitInterlacedMaskDrawProc(
  184.     FramePtr srcFrameP,
  185.     FramePtr dstFrameP,
  186.     Rect* srcRect,
  187.     Rect* dstRect);
  188.  
  189. SW_FUNC void BP8BitInterlacedPartialMaskDrawProc(
  190.     FramePtr srcFrameP,
  191.     FramePtr dstFrameP,
  192.     Rect* srcRect,
  193.     Rect* dstRect);
  194.  
  195. SW_FUNC void CompiledSprite8BitDrawProc(
  196.     FramePtr srcFrameP,
  197.     FramePtr dstFrameP,
  198.     Rect *srcRect,
  199.     Rect *dstRect);
  200.  
  201. SW_FUNC unsigned char BlitPixie8BitGetPixel(
  202.     FramePtr srcFrameP,
  203.     Point thePoint );
  204.  
  205. SW_FUNC void BlitPixie8BitSetPixel(
  206.     FramePtr srcFrameP,
  207.     Point thePoint,
  208.     unsigned char theColor);
  209.  
  210. SW_FUNC void SWAnimate8BitStarField(
  211.     SpriteWorldPtr    spriteWorldP,
  212.     StarArray        *starArray,
  213.     short            numStars,
  214.     short            backColor);
  215.  
  216. SW_FUNC void SWBlitPixie8BitFlipSprite(
  217.     SpritePtr srcSpriteP );
  218.  
  219. void BlitPixie8Bit(
  220.     register PixelChunkPtr srcPixelP,
  221.     register PixelChunkPtr dstPixelP,
  222.     register unsigned long rowsToCopy,
  223.     register unsigned long numBytesPerRow,
  224.     register unsigned long srcRowStride,
  225.     register unsigned long dstRowStride);
  226.  
  227. void BlitPixieMask8Bit(
  228.     register PixelPtr srcPixelP,
  229.     register PixelPtr dstPixelP,
  230.     register PixelPtr maskPixelP,
  231.     register unsigned long rowsToCopy,
  232.     register unsigned long numBytesPerRow,
  233.     register unsigned long srcRowStride,
  234.     register unsigned long dstRowStride);
  235.  
  236. void BlitPixiePartialMask8Bit(
  237.     register PixelPtr srcPixelP,
  238.     register PixelPtr dstPixelP,
  239.     register PixelPtr maskPixelP,
  240.     register unsigned long rowsToCopy,
  241.     register unsigned long numBytesPerRow,
  242.     register unsigned long srcRowStride,
  243.     register unsigned long dstRowStride);
  244.  
  245.  
  246. #ifdef __cplusplus
  247. }
  248. #endif
  249.  
  250. #if PRAGMA_ALIGN_SUPPORTED
  251. #pragma options align=reset
  252. #endif
  253.  
  254. #endif /* __BLITPIXIE__ */
  255.